using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace nBodyPhone
{
    class Body
    {
        Game1 game;
        public Color color;
        public Texture2D texture;
        public Vector2 position;
        public Vector2 texturePosition;
        public Vector2 velocity;
        public Vector2 distance;
        public Vector2 force;
        public Vector2 move;
        public float mass;
        public float radius;
        public bool alive;

        public Body(Color color, Texture2D texture, Vector2 position, Vector2 velocity, float mass, float radius)
        {
            this.color = color;
            this.texture = texture;
            this.position = position;
            this.texturePosition = new Vector2(position.X - texture.Width / 2, position.Y - texture.Height / 2);
            this.velocity = velocity;
            this.mass = mass;
            this.radius = radius;
            this.alive = true;
        }

        public void updateVelocity(Vector2 velocity)
        {
            this.velocity = velocity;
        }

        public void updatePosition(Vector2 position)
        {
            this.position = position;
            this.texturePosition = new Vector2(position.X - texture.Width / 2, position.Y - texture.Height / 2);
        }

        public string toString()
        {
            string info = "<vel(" + this.velocity.ToString() + ") mass(" + this.mass.ToString() + ")>";
            return info;
        }
    }
}
